package cn.jobstart.enums;

/**
*    @author sunke
*    @Date 2023-09-06 14:17:03
*    @description 企业性质
*/
import cn.jobstart.pubInter.EnumVO;
import java.util.ArrayList;
import java.util.List;

public enum CompanyNatureEnum {

    FOREIGN_CAPITAL(1, "外资") ,
    JOINT_VENTURE(2, "合资") ,
    STATE_OWNED_ENTERPRISE(3, "国企") ,
    PRIVATE_COMPANIES(4, "私营/民营公司") ,
    LISTED_COMPANY(5, "上市公司") ,
    FOREIGN_ENTERPRISE_REPRESENTING(6, "外企代表处") ,
    GOVERNMENT_OFFICE(7, "政府机关") ,
    PUBLIC_INSTITUTIONS(8, "事业单位") ,
    NON_PROFIT_ORGANIZATION(9, "非盈利机构") ,
    OTHER_NATURE(10, "其他性质") ; 




    private Integer type;
    private String desc;

    CompanyNatureEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDescByType(Integer type) {
        if(type==null ){
            type=0;
        }
        for (CompanyNatureEnum var : CompanyNatureEnum.values()) {
            if (type==var.getType().intValue())
                return var.getDesc();
             }
        return CompanyNatureEnum.values()[0].getDesc();
    }

    public static List<EnumVO> getDescs() {
        List list = new ArrayList();

        for (CompanyNatureEnum var : CompanyNatureEnum.values()) {
            EnumVO enumVO = new EnumVO();
            enumVO.setId(var.getType()+"");
            enumVO.setName(var.getDesc());
            list.add(enumVO);
        }


        return list;
    }

}
